﻿<Window x:Class="WPFDemo.WPFDemoWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:demoControls="clr-namespace:WPFDemo"
    Title="WPF DragScroller Controls Demo" 
        Height="750" Width="522"
        Loaded="Window_Loaded" >
    <Window.Resources>
        <ResourceDictionary>

       
        <LinearGradientBrush x:Key="GroupBackground" EndPoint="0.5,1" StartPoint="0.5,0" SpreadMethod="Pad" MappingMode="RelativeToBoundingBox">
            <GradientStop Color="#FFFFFFFF" Offset="0"/>
            <GradientStop Color="#FFFFFFFF" Offset="1"/>
            <GradientStop Color="#FF96CE99" Offset="0.515"/>
            <GradientStop Color="#FFD7E7D5" Offset="0.445"/>
        </LinearGradientBrush>
            
        </ResourceDictionary>
    </Window.Resources>
   

    <Grid Name="MainGrid" >
        <Grid Name="InnerGrid" >
            <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFFFFFFF" Offset="0"/>
                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                <GradientStop Color="#FF88BB85" Offset="0.236"/>
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.RowDefinitions >
                <RowDefinition Height="50" />
                <RowDefinition Height="500" />
                <RowDefinition Height="160" />
            </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
                <ColumnDefinition Width="500" />
                <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <TextBlock Grid.Row="0" Grid.ColumnSpan="3" Margin="0,5,0,0" Foreground="Black"  Name="TitleTextBlock" HorizontalAlignment="Center" TextAlignment="Center" FontSize="24"  VerticalAlignment="Top" Text="WPF Drag Scroller Control Demo" RenderTransformOrigin="0.5,0.5" >
        	<TextBlock.RenderTransform>
        		<TransformGroup>
        			<ScaleTransform ScaleX="1" ScaleY="1"/>
        			<SkewTransform AngleX="0" AngleY="0"/>
        			<RotateTransform Angle="0"/>
        			<TranslateTransform X="0" Y="0"/>
        		</TransformGroup>
        	</TextBlock.RenderTransform>
        </TextBlock>

       



        
        <Grid Panel.ZIndex="20" Grid.Row="1" Grid.Column="1" RenderTransformOrigin="0.5,0.5" x:Name="DragScrollerExample" Background="{DynamicResource GroupBackground}" >
            <Grid.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                    <SkewTransform AngleX="0" AngleY="0"/>
                    <RotateTransform Angle="0"/>
                    <TranslateTransform X="0" Y="0"/>
                </TransformGroup>
            </Grid.RenderTransform>
            <demoControls:DragScrollViewer x:Name="ExampleDragScrollViewer" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible" >
                <Grid >
                    <TextBlock Margin="10" TextWrapping="Wrap" >
                        <Run Text="     The Drag Scroller Control can be used when you have a large amount of material to show in a ScrollViewer and would like a fast and interactive way of traversing it."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     Using the mouse pointer, stylus, or finger (on touch screens), you can grab and flick the content of the control.  Depending on the value of the Friction property, the content can continue moving until it reaches the boundary of the control or can stop quickly after the 'throw'."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     (Click and hold anywhere on this control/text area, move your mouse/stylus/finger), and let up on the button while moving to fling the control.  The faster you 'fling', the farther the content will scroll)" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     ****This message is repeated to increase the size of the content to scroll through****" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     The Drag Scroller Control can be used when you have a large amount of material to show in a ScrollViewer and would like a fast and interactive way of traversing it."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     Using the mouse pointer, stylus, or finger (on touch screens), you can grab and flick the content of the control.  Depending on the value of the Friction property, the content can continue moving until it reaches the boundary of the control or can stop quickly after the 'throw'."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     (Click and hold anywhere on this control/text area, move your mouse/stylus/finger), and let up on the button while moving to fling the control.  The faster you 'fling', the farther the content will scroll)" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     ****This message is repeated to increase the size of the content to scroll through****" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     The Drag Scroller Control can be used when you have a large amount of material to show in a ScrollViewer and would like a fast and interactive way of traversing it."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     Using the mouse pointer, stylus, or finger (on touch screens), you can grab and flick the content of the control.  Depending on the value of the Friction property, the content can continue moving until it reaches the boundary of the control or can stop quickly after the 'throw'."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     (Click and hold anywhere on this control/text area, move your mouse/stylus/finger), and let up on the button while moving to fling the control.  The faster you 'fling', the farther the content will scroll)" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     ****This message is repeated to increase the size of the content to scroll through****" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     The Drag Scroller Control can be used when you have a large amount of material to show in a ScrollViewer and would like a fast and interactive way of traversing it."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     Using the mouse pointer, stylus, or finger (on touch screens), you can grab and flick the content of the control.  Depending on the value of the Friction property, the content can continue moving until it reaches the boundary of the control or can stop quickly after the 'throw'."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     (Click and hold anywhere on this control/text area, move your mouse/stylus/finger), and let up on the button while moving to fling the control.  The faster you 'fling', the farther the content will scroll)" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     ****This message is repeated to increase the size of the content to scroll through****" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     The Drag Scroller Control can be used when you have a large amount of material to show in a ScrollViewer and would like a fast and interactive way of traversing it."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     Using the mouse pointer, stylus, or finger (on touch screens), you can grab and flick the content of the control.  Depending on the value of the Friction property, the content can continue moving until it reaches the boundary of the control or can stop quickly after the 'throw'."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     (Click and hold anywhere on this control/text area, move your mouse/stylus/finger), and let up on the button while moving to fling the control.  The faster you 'fling', the farther the content will scroll)" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     ****This message is repeated to increase the size of the content to scroll through****" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     The Drag Scroller Control can be used when you have a large amount of material to show in a ScrollViewer and would like a fast and interactive way of traversing it."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     Using the mouse pointer, stylus, or finger (on touch screens), you can grab and flick the content of the control.  Depending on the value of the Friction property, the content can continue moving until it reaches the boundary of the control or can stop quickly after the 'throw'."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     (Click and hold anywhere on this control/text area, move your mouse/stylus/finger), and let up on the button while moving to fling the control.  The faster you 'fling', the farther the content will scroll)" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     ****This message is repeated to increase the size of the content to scroll through****" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     The Drag Scroller Control can be used when you have a large amount of material to show in a ScrollViewer and would like a fast and interactive way of traversing it."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     Using the mouse pointer, stylus, or finger (on touch screens), you can grab and flick the content of the control.  Depending on the value of the Friction property, the content can continue moving until it reaches the boundary of the control or can stop quickly after the 'throw'."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     (Click and hold anywhere on this control/text area, move your mouse/stylus/finger), and let up on the button while moving to fling the control.  The faster you 'fling', the farther the content will scroll)" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                                                <Run Text="     ****This message is repeated to increase the size of the content to scroll through****" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     The Drag Scroller Control can be used when you have a large amount of material to show in a ScrollViewer and would like a fast and interactive way of traversing it."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     Using the mouse pointer, stylus, or finger (on touch screens), you can grab and flick the content of the control.  Depending on the value of the Friction property, the content can continue moving until it reaches the boundary of the control or can stop quickly after the 'throw'."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     (Click and hold anywhere on this control/text area, move your mouse/stylus/finger), and let up on the button while moving to fling the control.  The faster you 'fling', the farther the content will scroll)" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                                                <Run Text="     ****This message is repeated to increase the size of the content to scroll through****" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     The Drag Scroller Control can be used when you have a large amount of material to show in a ScrollViewer and would like a fast and interactive way of traversing it."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     Using the mouse pointer, stylus, or finger (on touch screens), you can grab and flick the content of the control.  Depending on the value of the Friction property, the content can continue moving until it reaches the boundary of the control or can stop quickly after the 'throw'."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     (Click and hold anywhere on this control/text area, move your mouse/stylus/finger), and let up on the button while moving to fling the control.  The faster you 'fling', the farther the content will scroll)" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                                                <Run Text="     ****This message is repeated to increase the size of the content to scroll through****" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     The Drag Scroller Control can be used when you have a large amount of material to show in a ScrollViewer and would like a fast and interactive way of traversing it."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     Using the mouse pointer, stylus, or finger (on touch screens), you can grab and flick the content of the control.  Depending on the value of the Friction property, the content can continue moving until it reaches the boundary of the control or can stop quickly after the 'throw'."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     (Click and hold anywhere on this control/text area, move your mouse/stylus/finger), and let up on the button while moving to fling the control.  The faster you 'fling', the farther the content will scroll)" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                                                <Run Text="     ****This message is repeated to increase the size of the content to scroll through****" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     The Drag Scroller Control can be used when you have a large amount of material to show in a ScrollViewer and would like a fast and interactive way of traversing it."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     Using the mouse pointer, stylus, or finger (on touch screens), you can grab and flick the content of the control.  Depending on the value of the Friction property, the content can continue moving until it reaches the boundary of the control or can stop quickly after the 'throw'."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     (Click and hold anywhere on this control/text area, move your mouse/stylus/finger), and let up on the button while moving to fling the control.  The faster you 'fling', the farther the content will scroll)" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                                                <Run Text="     ****This message is repeated to increase the size of the content to scroll through****" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     The Drag Scroller Control can be used when you have a large amount of material to show in a ScrollViewer and would like a fast and interactive way of traversing it."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     Using the mouse pointer, stylus, or finger (on touch screens), you can grab and flick the content of the control.  Depending on the value of the Friction property, the content can continue moving until it reaches the boundary of the control or can stop quickly after the 'throw'."  />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="     (Click and hold anywhere on this control/text area, move your mouse/stylus/finger), and let up on the button while moving to fling the control.  The faster you 'fling', the farther the content will scroll)" />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        <LineBreak />
                        </TextBlock>
                </Grid>
            </demoControls:DragScrollViewer>

            <Border Grid.ColumnSpan="1" Grid.RowSpan="1" BorderThickness="3" BorderBrush="{StaticResource StandardBorderBrush}"  />

            </Grid>
        <Grid Panel.ZIndex="19" Grid.Row="2" Grid.Column="1" RenderTransformOrigin="0.5,0.5" x:Name="DragScrollerExampleSettings" Background="{DynamicResource GroupBackground}" >
            <Grid.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                    <SkewTransform AngleX="0" AngleY="0"/>
                    <RotateTransform Angle="0"/>
                    <TranslateTransform X="0" Y="0"/>
                </TransformGroup>
            </Grid.RenderTransform>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <TextBlock TextAlignment="Right" VerticalAlignment="Center" Margin="5" >Friction:</TextBlock>
                <Slider Grid.Column="1" Margin="5" Minimum="0" Maximum="1.0" VerticalAlignment="Center" Name="DragScrollFrictionSlider" ValueChanged="UpdateDragScrollFriction" Value="0.1" />

                <TextBlock Grid.Column="0" Grid.Row="1" TextAlignment="Right" VerticalAlignment="Center" Margin="5" >Show Scrollbars:</TextBlock>
                <CheckBox Name="ShowScrollbarsCheckbox" Grid.Column="1" Grid.Row="1" Margin="5" VerticalAlignment="Center" IsChecked="True" Checked="CheckBox_Click" Unchecked="CheckBox_Click" />

                <Border Grid.ColumnSpan="2" Grid.RowSpan="2" BorderThickness="3" BorderBrush="{StaticResource StandardBorderBrush}"  />

            </Grid>
        </Grid>



            <TextBlock Height="Auto" Margin="11,34,0,0" VerticalAlignment="Top" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" TextWrapping="Wrap" FontWeight="Bold" FontFamily="Arial" FontSize="18" FontStyle="Italic" x:Name="DragScrollerTitleShadow" Canvas.ZIndex="50" RenderTransformOrigin="0.1,0.5">
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform><Run Foreground="#AA000000" Text="Drag Scroller Control:"/></TextBlock>

          
            <TextBlock Height="Auto" Margin="10,33,0,0" VerticalAlignment="Top" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" TextWrapping="Wrap" FontWeight="Bold" FontFamily="Arial" FontSize="18" FontStyle="Italic" x:Name="DragScrollerTitle" Canvas.ZIndex="50" RenderTransformOrigin="0.1,0.5" Foreground="#FF000000">
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform><Run Foreground="#FF3EDD79" Text="Drag Scroller Control:"/></TextBlock>

          
            <TextBlock Height="Auto" Margin="11,501,0,0" VerticalAlignment="Top" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" TextWrapping="Wrap" FontWeight="Bold" FontFamily="Arial" FontSize="16" FontStyle="Italic" x:Name="DragScrollerSettingsShadow" Canvas.ZIndex="50" RenderTransformOrigin="0.1,0.5" IsHitTestVisible="False" >
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform><Run Foreground="#AA000000" Text="Settings:"/></TextBlock>

          
            <TextBlock Height="Auto" Margin="10,500,0,0" VerticalAlignment="Top" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" TextWrapping="Wrap" FontWeight="Bold" FontFamily="Arial" FontSize="16" FontStyle="Italic" x:Name="DragScrollerSettings" Canvas.ZIndex="50" RenderTransformOrigin="0.1,0.5" Foreground="#FF000000" IsHitTestVisible="False" >
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform><Run Foreground="#FF3EDD79" Text="Settings:"/></TextBlock>


        </Grid>
    </Grid>
</Window>
